package com.github.admin.edu.security.jwt.server.controller;

import com.github.admin.edu.oauth.server.api.service.ServiceUserRoleManagerApi;
import com.github.admin.edu.security.jwt.server.service.impl.ServerUserRoleManagerServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by IntelliJ IDEA.
 * user:wangj
 * date:2018/8/12
 * Time: 19:20
 */
@RestController
public class ServiceUserRoleManagerController implements ServiceUserRoleManagerApi {

    @Autowired
    private ServerUserRoleManagerServiceImpl service;

    @Override
    public String getEntity(Long id) {

        return service.getEntity(id);

    }

    @Override
    public String saveOrUpdate(@RequestBody String jsonEntity) {

        return service.saveOrUpdate(jsonEntity);

    }

    @Override
    public String getAllByPager(String title, Integer current, Integer rows, String order, String fileId) {

        return service.getAllGetEntity(title,current,rows,order,fileId);

    }

    @Override
    public String getALLByPager(@RequestBody String jsonEntity) {

        return service.getALLPostByPager(jsonEntity);
    }

    @Override
    public String getAllEntity(String title, String order, String fileId) {

        return service.getAllEntity(title,order,fileId);
    }

    @Override
    public String deleteAll(String ids) {

        return service.delete(ids);
    }

    @Override
    public String getUserRole(String userId, Integer roleId) {

        return service.getUserRole(userId,roleId);
    }
}
